'''
while循环打印九九乘法表
'''
i=1;
while i<10:
    j=1;
    while j<=i:
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j,'*',i,'=',i*j), end=' ')
        j+=1;
    print('')
    i+=1;

#打印分隔符
print('='*110)

i=9;
while i>0:
    j=1;
    while j<=i:
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j, '*', i, '=', i * j), end=' ')
        j+=1;
    print('')
    i-=1;

#打印分隔符
print('-'*110)

#for循环打印九九乘法表
for i in range(1,10):
    for j in range(1,i+1):
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j, '*', i, '=', i * j), end=' ')
    print('')

#打印分隔符
print('='*110)

for i in range(9,0,-1):
    for j in range(1,i+1):
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j, '*', i, '=', i * j), end=' ')
    print('')


#打印分隔符
print('-'*110)


i=9;
while i>0:
    j=9;
    while j-i>=0:
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j,'*',i,'=',i*j), end=' ')
        j-=1;
    print('')
    i-=1;

#打印分隔符
print('='*110)

i=1;
while i<10:
    j=9;
    while j-i>=0:
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j,'*',i,'=',i*j), end=' ')
        j-=1;
    print('')
    i+=1;


#打印分隔符
print('-'*110)

for i in range(9,0,-1):
    for j in range(9,i-1,-1):
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j, '*', i, '=', i * j), end=' ')
    print('')

#打印分隔符
print('='*110)

for i in range(1,10,1):
    for j in range(9,i-1,-1):
        print('{0:<2}{1:<2}{2:<2}{3:<2}{4:<3}'.format(j, '*', i, '=', i * j), end=' ')
    print('')